import logging

import HTMLTestRunner_PY3
import yagmail


class yj():
    def Log(self):
        log=logging.basicConfig(
            level=logging.DEBUG,
            filemode='a+',
            format='%(levelname)s %(filename)s %(message)s %(asctime)s %(lineno)d',
            filename='A3mall.log'
        )
        return log
    def Report(self):
        report=HTMLTestRunner_PY3.HTMLTestRunner(open('A3mall.html', 'wb'), title='A3mall1.0测试结果', description='A3mall鼓舞下单')
        return report

    def Email(self):
        mail=yagmail.SMTP(user='1204038956@qq.com',password='klzzhcsfmaejiddb',port='465',host='smtp.qq.com')
        mail.send(to='1204038956@qq.com',subject='测试报告',contents=['A3mall.logs','A3mall.html','A3mall1.0测试报告'])
        mail.close()